/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
}

/* 游戏容器 - 全屏 */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a2e, #16213e, #0f3460);
    overflow: hidden;
}

/* Canvas - 全屏适配 */
#gameCanvas {
    display: block;
    background: #000;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 游戏UI层 */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* HUD样式 */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: none; /* 隐藏HUD，避免挡住游戏场景 */
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(20,20,40,0.9));
    border: 2px solid #00ff88;
    border-radius: 15px;
    box-shadow: 
        0 0 20px rgba(0,255,136,0.3),
        inset 0 0 20px rgba(0,255,136,0.1);
    backdrop-filter: blur(10px);
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0,255,136,0.5);
}

.player-stats, .level-info, .enemy-counter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lives, .score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon {
    font-size: 20px;
    filter: drop-shadow(0 0 5px currentColor);
}

/* 菜单样式 */
.menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    z-index: 100;
}

.menu.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid #00ff88;
    border-radius: 20px;
    box-shadow: 
        0 0 50px rgba(0,255,136,0.5),
        inset 0 0 30px rgba(0,255,136,0.1);
    backdrop-filter: blur(15px);
    min-width: 400px;
}

.menu-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0,255,136,0.8);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.menu-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0,255,136,0.6);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

/* 按钮样式 */
button {
    padding: 15px 30px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 4px 15px rgba(0,255,136,0.4),
        inset 0 1px 3px rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    pointer-events: all;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0,255,136,0.6),
        inset 0 1px 3px rgba(255,255,255,0.3);
}

button:hover:before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0,255,136,0.4),
        inset 0 1px 3px rgba(255,255,255,0.2);
}

/* 控制提示 */
.controls-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.control-hint {
    display: flex;
    gap: 30px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.7);
    border: 1px solid #00ff88;
    border-radius: 25px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(0,255,136,0.3);
}

.control-hint span {
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0,255,136,0.5);
}

/* 动画效果 */
@keyframes titleGlow {
    0% {
        text-shadow: 0 0 30px rgba(0,255,136,0.8);
    }
    100% {
        text-shadow: 0 0 50px rgba(0,255,136,1), 0 0 80px rgba(0,204,255,0.8);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hud {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .menu-content {
        min-width: 300px;
        padding: 30px 20px;
    }
    
    .menu-content h1 {
        font-size: 36px;
    }
    
    .control-hint {
        flex-direction: column;
        gap: 10px;
        font-size: 12px;
    }
    
    button {
        padding: 12px 24px;
        font-size: 16px;
    }
}

@media (max-height: 600px) {
    .hud {
        top: 10px;
        padding: 8px 15px;
    }
    
    .controls-info {
        bottom: 10px;
    }
}

/* 加载动画 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff88;
    font-size: 24px;
    text-align: center;
}

.loading:after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 粒子效果背景 */
.game-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(0,255,136,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0,204,255,0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(0,255,136,0.3), transparent);
    background-size: 200px 100px;
    animation: stars 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes stars {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

/* AI难度设置样式 */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    max-width: 400px;
}

.difficulty-item {
    position: relative;
}

.difficulty-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.difficulty-item label {
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.difficulty-item label:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.difficulty-item input[type="radio"]:checked + label {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.difficulty-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.difficulty-desc {
    font-size: 14px;
    color: #cccccc;
    opacity: 0.8;
}

.difficulty-item input[type="radio"]:checked + label .difficulty-name {
    color: #00ff88;
}

.difficulty-item input[type="radio"]:checked + label .difficulty-desc {
    color: #ffffff;
    opacity: 1;
} 